import pytest, time
from selenium.webdriver.common.by import By


class TrafficSecurityMonitoringLocator:
    """
        User Center 页面
    """
    # 首页提示弹框返回按钮
    product_cancel_button = (By.XPATH, '/html/body/div[3]/div/div[2]/div/div[2]/div/div/div[2]/button[1]/span')
    # 首页菜单按钮//*[@id="root"]/section/div/div/div[1]
    product_menu_button = (By.XPATH, '//*[@id="root"]/section/div/div/div[1]')
    # 菜单页面
    product_menu_page = (By.XPATH, '//*[@id="root"]/section/div/div/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div')
    # TSM Traffic Security Monitoring菜单按钮
    tsm_menu_button = (By.XPATH, '//*[@id="root"]/section/div/div/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div/div[2]/div/div/div[5]/div[3]/div[5]')
    # TSM控制台页面标题
    tsm_console_title = (By.CSS_SELECTOR, '[class="cre-sider-menu-header"]')
    # iframe
    into_iframe = (By.CSS_SELECTOR, '[id="hj_container"]')

    # TDS Traffic Security Monitoring菜单按钮
    tds_menu_button = (By.XPATH, '//*[@id="root"]/section/div/div/div[2]/div[2]/div/div/div[2]/div/div/div[2]/div/div[2]/div/div/div[5]/div[3]/div[3]')
    # TDS控制台页面标题Threat Detection Service
    tds_console_title = (By.CSS_SELECTOR, '[class="cre-sider-menu-header"]')

    # Traffic Security Monitoring页面
    # Traffic Trends标签
    tsm_tt_title = (By.XPATH, '(//*[@class="antd4-menu-title-content"])[1]')
    # Internet Border标签
    tsm_ib_title = (By.XPATH, '(//*[@class="antd4-menu-title-content"])[2]')
    # Internal Network Border标签
    tsm_inb_title = (By.XPATH, '(//*[@class="antd4-menu-title-content"])[3]')
    # Packet Capture标签
    tsm_pc_title = (By.XPATH, '(//*[@class="antd4-menu-title-content"])[4]')

    # Traffic Trends页面标题
    tsm_tt_page_title = (By.XPATH, '(//*[@class="title-wrap"])/h3')
    # Traffic Trends页面的Network Traffic Trend 标题栏
    tsm_tt_network_title = (By.XPATH, '(//*[@class="online-flow-trend panel"])/div[1]/div[1]')
    # Traffic Trends页面的Inbound Traffic  标题栏
    tsm_tt_inbound_title = (By.XPATH, '(//*[@class="online-in-direction panel"])[1]/div[1]')
    # Traffic Trends页面的Outbound Traffic  标题栏
    tsm_tt_outbound_title = (By.XPATH, '(//*[@class="online-in-direction panel"])[2]/div[1]')

    # Internet Border页面标题Internet Boundary Traffic Analysis
    tsm_ib_page_title = (By.XPATH, '(//*[@class="title-wrap"])/h3')
    # Internet Border页面的时间选择Last 1 Hour按钮
    tsm_tt_ib_1hour_btn = (By.XPATH, '(//*[@class="next-btn-group"])/button[1]/span')
    # Internet Border页面的时间选择Last 24 Hours按钮
    tsm_tt_ib_24hours_btn = (By.XPATH, '(//*[@class="next-btn-group"])/button[2]/span')
    # Internet Border页面的时间选择Last 7 Days按钮
    tsm_tt_ib_7days_btn = (By.XPATH, '(//*[@class="next-btn-group"])/button[3]/span')
    # Internet Border页面的Traffic Statistics标题栏
    tsm_tt_ib_statistics_title = (By.XPATH, '(//*[@class="product-container-inner"])/div/div[2]/h5[1]')
    # Internet Border页面的Traffic List标题栏
    tsm_tt_ib_list_title = (By.XPATH, '(//*[@class="product-container-inner"])/div/div[2]/h5[2]')
    # Internet Border页面的Visits to IP区标题
    tsm_tt_ib_visits_ip_title = (By.XPATH, '(//*[@class="product-container-inner"])/div/div[2]/div[2]/div[1]/div/p')
    # Internet Border页面的Average Traffic区标题
    tsm_tt_ib_average_title = (By.XPATH, '(//*[@class="panel"])/div/div/div/div[1]/div/div[1]/div[1]')
    # Internet Border页面的Peak Traffic区标题
    tsm_tt_ib_peak_title = (By.XPATH, '(//*[@class="panel"])/div/div/div/div[1]/div/div[2]/div[1]')
    # Internet Border页面的Traffic List区的By Source IP tab标题
    tsm_tt_ib_list_source_tab = (By.XPATH, '(//*[@class="next-tabs-nav"])/li[1]/div')
    # Internet Border页面的Traffic List区的By Destination IP tab标题
    tsm_tt_ib_list_destination_tab = (By.XPATH, '(//*[@class="next-tabs-nav"])/li[2]/div')

    # Internal Network Border页面标题Internet Boundary Traffic Analysis
    tsm_inb_page_title = (By.XPATH, '(//*[@class="title-wrap"])/h3')
    # Internal Network Border页面的时间选择Last 1 Hour按钮
    tsm_tt_inb_1hour_btn = (By.XPATH, '(//*[@class="next-btn-group"])/button[1]/span')
    # Internal Network Border页面的时间选择Last 24 Hours按钮
    tsm_tt_inb_24hours_btn = (By.XPATH, '(//*[@class="next-btn-group"])/button[2]/span')
    # Internal Network Border页面的时间选择Last 7 Days按钮
    tsm_tt_inb_7days_btn = (By.XPATH, '(//*[@class="next-btn-group"])/button[3]/span')
    # Internal Network Border页面的Traffic Statistics标题栏
    tsm_tt_inb_statistics_title = (By.XPATH, '(//*[@class="product-container-inner"])/div/div[2]/h5[1]')
    # Internal Network Border页面的Traffic List标题栏
    tsm_tt_inb_list_title = (By.XPATH, '(//*[@class="product-container-inner"])/div/div[2]/h5[2]')
    # Internal Network Border页面的Visits to IP区标题
    tsm_tt_inb_visits_ip_title = (By.XPATH, '(//*[@class="product-container-inner"])/div/div[2]/div[2]/div[1]/div/p')
    # Internal Network Border页面的Average Traffic区标题
    tsm_tt_inb_average_title = (By.XPATH, '(//*[@class="panel"])/div/div/div/div[1]/div/div[1]/div[1]')
    # Internal Network Border页面的Peak Traffic区标题
    tsm_tt_inb_peak_title = (By.XPATH, '(//*[@class="panel"])/div/div/div/div[1]/div/div[2]/div[1]')
    # Internal Network Border页面的Traffic List区的By Source IP tab标题
    tsm_tt_inb_list_source_tab = (By.XPATH, '(//*[@class="next-tabs-nav"])/li[1]/div')
    # Internal Network Border页面的Traffic List区的By Destination IP tab标题
    tsm_tt_inb_list_destination_tab = (By.XPATH, '(//*[@class="next-tabs-nav"])/li[2]/div')

    # Packet Capture页面标题Packet Capture
    tsm_pc_page_title = (By.XPATH, '(//*[@class="title-wrap"])/h3')
    # Packet Capture页面新建数据按钮Create Packet Capture Task
    tsm_pc_page_create_btn = (By.XPATH, '(//*[@class="left-operate"])/button/span')
    # Packet Capture页面默认最近时间Last 30 Days标题
    tsm_pc_page_last_default_tittle = (By.XPATH, '(//*[@class="select-time"])/span/span/span/em')
    # Packet Capture页面最近时间按钮
    tsm_pc_page_last_time_btn = (By.XPATH, '(//*[@class="select-time"])/span/span[1]')
    # Packet Capture页面最近时间复选框Last 1 Day按钮
    tsm_pc_page_last_1day_btn = (By.XPATH, '(//*[@class="next-menu-item-text"])[1]')
    # Packet Capture页面最近时间复选框Last 7 Days按钮
    tsm_pc_page_last_7days_btn = (By.XPATH, '(//*[@class="next-menu-item-text"])[2]')
    # Packet Capture页面最近时间复选框Last 30 Days按钮
    tsm_pc_page_last_30days_btn = (By.XPATH, '(//*[@class="next-menu-item-text"])[3]')
    # Packet Capture页面最近时间复选框Custom按钮
    tsm_pc_page_custom_btn = (By.XPATH, '(//*[@class="next-menu-item-text"])[4]')
    # Packet Capture页面新建数据捕获任务页面标题Create Packet Capture Task
    tsm_pc_page_create_task_page_tittle = (By.XPATH, '(//*[@class="next-col panel-header-title"])/h5')
    # Packet Capture页面新建数据捕获任务页面必填参数标题Task Name
    tsm_create_task_name_tittle = (By.XPATH, '(//*[@class="panel-body-content"])/form/div[1]/div/label[1]')
    # Packet Capture页面新建数据捕获任务页面必填参数标题Maximum Bytes
    tsm_create_maximum_bytes_tittle = (By.XPATH, '(//*[@class="panel-body-content"])/form/div[2]/div/label[1]')
    # Packet Capture页面新建数据捕获任务页面必填参数标题Duration (s)
    tsm_create_duration_tittle = (By.XPATH, '(//*[@class="panel-body-content"])/form/div[3]/div/label[1]')
    # Packet Capture页面新建数据捕获任务页面必填参数标题IP
    tsm_create_ip_tittle = (By.XPATH, '(//*[@class="panel-body-content"])/form/div[7]/div/label[1]')
    # Packet Capture页面新建数据捕获任务页面必填参数标题Port
    tsm_create_port_tittle = (By.XPATH, '(//*[@class="panel-body-content"])/form/div[8]/div/label[1]')
    # Packet Capture页面新建数据捕获任务页面OK按钮
    tsm_create_ok_btn = (By.XPATH, '(//*[@class="panel-body-content"])/form/div[9]/div[2]/button/span')

    # Threat Detection Service页面标题 Overview
    tds_page_title = (By.XPATH, '(//*[@class="title-wrap"])/h3')
    # Threat Detection Service页面Overview的标题栏
    tds_overview_title = (By.XPATH, '(//*[@class="antd4-layout-sider-children"])/div[2]/div[2]/ul/li[1]/span/div')
    # Threat Detection Service页面的Security Alerts标题栏
    tds_security_alerts_title = (By.XPATH, '(//*[@class="antd4-layout-sider-children"])/div[2]/div[2]/ul/li[2]/span/div')
    # Threat Detection Service页面的Attack Analysis标题栏
    tds_attack_analysis_title = (By.XPATH, '(//*[@class="antd4-layout-sider-children"])/div[2]/div[2]/ul/li[3]/span/div')
    # Threat Detection Service页面Cloud Service Check的标题栏
    tds_cloud_service_check_title = (By.XPATH, '(//*[@class="antd4-layout-sider-children"])/div[2]/div[2]/ul/li[4]/span/div')
    # Threat Detection Service页面的Application Whitelists标题栏
    tds_application_whitelists_title = (By.XPATH, '(//*[@class="antd4-layout-sider-children"])/div[2]/div[2]/ul/li[5]/span/div')
    # Threat Detection Service页面的Assets标题栏
    tds_assets_title = (By.XPATH, '(//*[@class="antd4-layout-sider-children"])/div[2]/div[2]/ul/li[6]/span/div')
    # Threat Detection Service页面Security Reports的标题栏
    tds_security_reports_title = (By.XPATH, '(//*[@class="antd4-layout-sider-children"])/div[2]/div[2]/ul/li[7]/span/div')
    # Threat Detection Service-Overview页面的Security overview tab标题
    tds_security_overview_tab = (By.XPATH, '(//*[@class="next-tabs-tab-inner"])[1]')
    # Threat Detection Service-Overview页面的Security Screen tab标题
    tds_security_screen_tab = (By.XPATH, '(//*[@class="next-tabs-tab-inner"])[2]')
    # Threat Detection Service-Overview页面的Security Score标题
    tds_security_score_title = (By.XPATH, '(//*[@class="card-head"])[1]/span')
    # Threat Detection Service-Overview页面的Asset Status标题
    tds_asset_status_title = (By.XPATH, '(//*[@class="card-head"])[2]/span')




